clear
set more off

if regexm(c(os),"Mac") == 1 {
	cd "~/Dropbox/Corporate Returns to Campaign Contributions/JOP/qpq_replication"
	}
	else if regexm(c(os),"Windows") == 1 {
	cd "~\Dropbox\Corporate Returns to Campaign Contributions\JOP/qpq_replication"
}

********************************************************************************
*********************** TABLE 1: RD ESTIMATES  *********************************
********************************************************************************

use "qpq_main_dataset", clear

********************** PANEL A: CAR(-1, 1) *************************************

*******************************************
* Close election threshold: 1 pp
*******************************************

preserve

drop if abs(rv) > 0.005

reghdfe CAR_minus1_1 victory, absorb(constant) vce(cluster cycle) /* Local constant */

reghdfe CAR_minus1_1 victory rv rv_victory, absorb(constant) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2, absorb(constant) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3, absorb(constant) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Close election threshold: 2.5 pp
*******************************************

preserve

drop if abs(rv) > 0.0125

reghdfe CAR_minus1_1 victory, absorb(constant) vce(cluster cycle) /* Local constant */

reghdfe CAR_minus1_1 victory rv rv_victory, absorb(constant) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2, absorb(constant) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3, absorb(constant) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Close election threshold: 5 pp
*******************************************

preserve

drop if abs(rv) > 0.025

reghdfe CAR_minus1_1 victory, absorb(constant) vce(cluster cycle) /* Local constant */

reghdfe CAR_minus1_1 victory rv rv_victory, absorb(constant) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2, absorb(constant) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3, absorb(constant) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Close election threshold: 10 pp
*******************************************

preserve

drop if abs(rv) > 0.05

reghdfe CAR_minus1_1 victory, absorb(constant) vce(cluster cycle) /* Local constant */

reghdfe CAR_minus1_1 victory rv rv_victory, absorb(constant) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2, absorb(constant) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3, absorb(constant) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Imbens-Kalyanaraman optimal bandwidth
*******************************************

preserve 

rdob CAR_minus1_1 rv, c(0)

* h_opt: .0993

reghdfe CAR_minus1_1 victory if abs(rv) < .0993, absorb(constant) vce(cluster cycle) /* Local constant */

reghdfe CAR_minus1_1 victory rv rv_victory if abs(rv) < .0993, absorb(constant) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 if abs(rv) < .0993, absorb(constant) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3 if abs(rv) < .0993, absorb(constant) vce(cluster cycle) /* Cubic */

restore 


*******************************************
* Calonico, Cattaneo, and Titiunik (2014)
*******************************************

preserve 

rdbwselect CAR_minus1_1 rv, c(0) p(0) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

reghdfe CAR_minus1_1 victory if abs(rv) < `CCT_bw', absorb(constant) vce(cluster cycle) /* Local constant */

rdbwselect CAR_minus1_1 rv, c(0) p(1) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

reghdfe CAR_minus1_1 victory rv rv_victory if abs(rv) < `CCT_bw', absorb(constant) vce(cluster cycle) /* Local linear */

rdbwselect CAR_minus1_1 rv, c(0) p(2) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 if abs(rv) < `CCT_bw', absorb(constant) vce(cluster cycle) /* Quadratic */

rdbwselect CAR_minus1_1 rv, c(0) p(3) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3 if abs(rv) < `CCT_bw', absorb(constant) vce(cluster cycle) /* Cubic */

restore 

******************** PANEL B: RACE FIXED EFFECTS *******************************

*******************************************
* Close election threshold: 1 pp
*******************************************

preserve

drop if abs(rv) > 0.005

areg CAR_minus1_1 victory, absorb(election) vce(cluster cycle) /* Local constant */

areg CAR_minus1_1 victory rv, absorb(election) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
areg CAR_minus1_1 victory rv rv_2 , absorb(election) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
areg CAR_minus1_1 victory rv  rv_2 ///
rv_3 , absorb(election) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Close election threshold: 2.5 pp
*******************************************

preserve

drop if abs(rv) > 0.0125

areg CAR_minus1_1 victory, absorb(election) vce(cluster cycle) /* Local constant */

areg CAR_minus1_1 victory rv, absorb(election) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
areg CAR_minus1_1 victory rv  rv_2 , absorb(election) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
areg CAR_minus1_1 victory rv  rv_2  ///
rv_3 , absorb(election) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Close election threshold: 5 pp
*******************************************

preserve

drop if abs(rv) > 0.025

areg CAR_minus1_1 victory, absorb(election) vce(cluster cycle) /* Local constant */

areg CAR_minus1_1 victory rv , absorb(election) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
areg CAR_minus1_1 victory rv  rv_2 , absorb(election) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
areg CAR_minus1_1 victory rv  rv_2  ///
rv_3 , absorb(election) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Close election threshold: 10 pp
*******************************************

preserve

drop if abs(rv) > 0.05

areg CAR_minus1_1 victory, absorb(election) vce(cluster cycle) /* Local constant */

areg CAR_minus1_1 victory rv , absorb(election) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
areg CAR_minus1_1 victory rv  rv_2 , absorb(election) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
areg CAR_minus1_1 victory rv rv_2 ///
rv_3 , absorb(election) vce(cluster cycle) /* Cubic */

restore


*******************************************
* Imbens-Kalyanaraman optimal bandwidth
*******************************************

preserve 

rdob CAR_minus1_1 rv, c(0)

* h_opt: .0993

reghdfe CAR_minus1_1 victory if abs(rv) < .0993, absorb(election) vce(cluster cycle) /* Local constant */

reghdfe CAR_minus1_1 victory rv rv_victory if abs(rv) < .0993, absorb(election) vce(cluster cycle) /* Local linear */

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 if abs(rv) < .0993, absorb(election) vce(cluster cycle) /* Quadratic */

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3 if abs(rv) < .0993, absorb(election) vce(cluster cycle) /* Cubic */

restore

*******************************************
* Calonico, Cattaneo, and Titiunik (2014)
*******************************************

preserve 

rdbwselect CAR_minus1_1 rv, c(0) p(0) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

reghdfe CAR_minus1_1 victory if abs(rv) < `CCT_bw', absorb(election) vce(cluster cycle) /* Local constant */

rdbwselect CAR_minus1_1 rv, c(0) p(1) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

reghdfe CAR_minus1_1 victory rv rv_victory if abs(rv) < `CCT_bw', absorb(election) vce(cluster cycle) /* Local linear */

rdbwselect CAR_minus1_1 rv, c(0) p(2) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

gen rv_2     = rv^2
gen rv_vic_2 = rv_2*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 if abs(rv) < `CCT_bw', absorb(election) vce(cluster cycle) /* Quadratic */

rdbwselect CAR_minus1_1 rv, c(0) p(3) vce(cluster cycle)
local CCT_bw = `e(h_mserd)'

gen rv_3     = rv^3
gen rv_vic_3 = rv_3*victory
reghdfe CAR_minus1_1 victory rv rv_victory rv_2 rv_vic_2 ///
rv_3 rv_vic_3 if abs(rv) < `CCT_bw', absorb(election) vce(cluster cycle) /* Cubic */

restore 


********************************************************************************
************ TABLE 2: ANALYSIS OF SUBSAMPLES ***********************************
********************************************************************************


use "qpq_main_dataset", clear


* Calculate money donated by firm to candidate
g totaldollars_cand = totalrep
replace totaldollars_cand = totaldem if dem==1

* Sectors
g sector = "other"
replace sector = "agri_mining" if siccd > 99 & siccd < 1500
replace sector = "construction" if siccd > 1499 & siccd < 1800
replace sector = "manufacturing" if siccd > 1999 & siccd < 4000
replace sector = "trans_elec" if siccd > 3999 & siccd < 5000
replace sector = "whole_ret_trade" if siccd > 4999 & siccd < 6000
replace sector = "finance" if siccd > 5999 & siccd < 6800
replace sector = "services" if siccd > 6999 & siccd < 9000
replace sector = "public_adm" if siccd > 9099 & siccd < 9730
g other = sector != "finance" & sector != "manufacturing" & sector != "trans_elec"

* Number of other winners supported by firm in cycle
egen otherwinners = sum(victory), by(firm_cycle)
replace otherwinners = otherwinners - victory

* Full Sample
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05, absorb(constant) cluster(cycle)

* Donut
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & abs(rv) > .001, absorb(constant) cluster(cycle)

**** BY OFFICE *******

* Governors
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & setting == "gov", absorb(constant) cluster(cycle)
* U.S. Senate
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & setting == "senate", absorb(constant) cluster(cycle)
* U.S. House
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & setting == "house", absorb(constant) cluster(cycle)
* State Senate
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & setting == "stlegupper", absorb(constant) cluster(cycle)
* State House
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & setting == "stleglower", absorb(constant) cluster(cycle)

**** BY DONATION SIZE *******

* Donations >= $500
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totaldollars_cand >= 500, absorb(constant) cluster(cycle)
* Donations >= $1000
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totaldollars_cand >= 1000, absorb(constant) cluster(cycle)
* Donations >= $2500
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totaldollars_cand >= 2500, absorb(constant) cluster(cycle)

**** BY FIRM VALUE *******

* < 200 M
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & market_cap < 200 & market_cap != ., absorb(constant) cluster(cycle)
* 200M-1B
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & market_cap >= 200 & market_cap <= 1000 & market_cap != ., absorb(constant) cluster(cycle)
* 1-5B
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & market_cap > 1000 & market_cap <= 5000 & market_cap != ., absorb(constant) cluster(cycle)
* > 5B
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & market_cap >= 5000 & market_cap != ., absorb(constant) cluster(cycle)

**** BY SECTOR *******

* Manufacturing (Division D)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & sector == "manufacturing", absorb(constant) cluster(cycle)
* Transportation (Division E)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & sector == "trans_elec", absorb(constant) cluster(cycle)
* Finance (Division H)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & sector == "finance", absorb(constant) cluster(cycle)
* Other Industry
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & other == 1, absorb(constant) cluster(cycle)

**** PRE-POST CITIZENS UNITED *******

* Pre Citizens United (<2010)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & year < 2010, absorb(constant) cluster(cycle)
* Post Citizens United (2010)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & year == 2010, absorb(constant) 

**** BY # OF OTHER WINNERS SUPPORTED *******

* 0 Other Winners Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & otherwinners == 0, absorb(constant) cluster(cycle)

* 1-5 Other Winners Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & otherwinners >= 1 & otherwinners <= 5, absorb(constant) cluster(cycle)

* 6-10 Other Winners Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & otherwinners >= 6 & otherwinners <= 10, absorb(constant) cluster(cycle)

* 11-20 Other Winners Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & otherwinners >= 11 & otherwinners <= 20, absorb(constant) cluster(cycle)

* 21-100 Other Winners Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & otherwinners >= 21 & otherwinners <= 100, absorb(constant) cluster(cycle)

* > 100 Other Winners Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & otherwinners > 100, absorb(constant) cluster(cycle)

**** BY # OF CANDIDATES SUPPORTED *******

* Candidates Supported by Firm in Cycle
egen totalcandidates = sum(constant), by(firm_cycle)

* Summary statistics for candidates supported by firm in cycle (full sample)
su totalcandidates, detail

* < 5 Candidates Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totalcandidates < 6, absorb(constant) cluster(cycle)
* < 5 Candidates Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totalcandidates >= 6 & totalcandidates < 51, absorb(constant) cluster(cycle)
* > 50 Candidates Supported by Firm in Cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totalcandidates > 50, absorb(constant) cluster(cycle)

* By Quartiles
* 1st quartile (Less than 34 candidates supported in cycle)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totalcandidates<34, absorb(constant) cluster(cycle)
* 2nd quartile (Between 34 and 84 candidates supported in cycle)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totalcandidates>=34 & totalcandidates<84, absorb(constant) cluster(cycle)
* 3rd quartile (Between 84 and 227 candidates supported in cycle)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totalcandidates>=84 & totalcandidates<=227, absorb(constant) cluster(cycle)
* 4th quartile (More than 227 candidates supported in cycle)
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & totalcandidates>227, absorb(constant) cluster(cycle)

**** BY SHARE OF SAME-CYCLE DONATIONS GIVEN TO DEMS *******

* Frac to dem in cycle
egen number_supp = sum(constant), by(firm cycle)
egen number_dem  = sum(dem), by(firm cycle)
gen frac_dem_supp = number_dem/number_supp

* < 1/3 to Dem in cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & frac_dem_supp <= 1/3, absorb(constant) cluster(cycle)
* 1/3 < x < 2/3 to Dem in cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & frac_dem_supp > 1/3 & frac_dem_supp < 2/3, absorb(constant) cluster(cycle)
* > 2/3 to Dem in cycle
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & frac_dem_supp >= 2/3, absorb(constant) cluster(cycle)

**** BY # OF FIRMS SUPPORTING THE WINNER *******

* Number of firms supporting the winner
egen num_f_win = sum(victory), by(election)

* 1 firm supported the winner
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & num_f_win == 1, absorb(constant) cluster(cycle)

* 2-4 firms supported the winner 
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & num_f_win < 5 & num_f_win > 1, absorb(constant) cluster(cycle)

* 5 <= x < 15 firms supported the winner
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & num_f_win >= 5 & num_f_win < 15, absorb(constant) cluster(cycle)

* >= 15 firms supported the winner
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & num_f_win >= 15, absorb(constant) cluster(cycle)

**** BY CONTROL OF CHAMBER *******


* Winner will belong to majority party in chamber
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & winner_control==1, absorb(constant) cluster(cycle)
* Winner will belong to minority party in chamber
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & winner_control==0, absorb(constant) cluster(cycle)

**** BY INCUMBENCY STATUS OF SUPPORTED CANDIDATES *******

g incumbent = dem == 1 & deminc == 1
replace incumbent = 1 if dem == 0 & repinc == 1
g challenger = dem == 1 & repinc == 1
replace challenger = 1 if dem == 0 & deminc == 1
replace challenger = 1 if deminc == 0 & repinc == 0

areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & incumbent == 1, absorb(constant) vce(cluster cycle) 
areg CAR_minus1_1 victory rv rv_victory if abs(rv) < .05 & challenger == 1, absorb(constant) vce(cluster cycle) 


********************************************************************************
************ TABLE 3: BETTING PRICES HIGH FREQUENCY ANALYSIS *******************
********************************************************************************

use "qpq_intrade", clear

* 120 elections

set more off

sort donat bet_date
by donat: gen nobs = _n 

xtset donat nobs
sort donat nobs

* Generate dummy for supporting the Republican candidate
gen rep = 0
replace rep = 1 if dem == 0

* Generate the party-cycle dummy
egen party_cycle = group(cycle dem)

* Generate the firm dummy
egen firm = group(permco)

* Generate the firm-cycle dummy
egen firm_cycle = group(permco cycle)

* Generate the firm-race dummy
egen firm_election = group(permco election)

* Transform betting price to implied winning probability
gen dem_prob = dem_price/100
gen rep_prob = rep_price/100

* Remove a race with a Rep vs libertarian (IN 06), as complementary bet price
* does not correspond to the Dem candidate (inexistent). Also SD 10, as Rep
* was unchallenged. Finally, CT 06 is also dropped, as Lieberman (Dem) lost 
* the primary but formed his own party and won. VT 06 Sanders was independent

drop if state == "IN" & cycle == 2006
drop if state == "SD" & cycle == 2010
drop if state == "CT" & cycle == 2006
drop if state == "VT" & cycle == 2006

*********** DAILY ANALYSIS *********************************

gen constant = 1

* Variable that gives implied winning probability of the recipient candidate
gen prob_cand = dem_prob
replace prob_cand = rep_prob if rep == 1
gen dprob_cand = d.prob_cand

* Generate week variable
format bet_date %td
epiweek bet_date, epiw(week) epiy(epi_year)
egen week_y = group(week epi_year)

* PANEL A Results

reghdfe abnormal_return dprob_cand, absorb(constant) vce(cluster week_y election)
reghdfe abnormal_return dprob_cand, absorb(firm_cycle) vce(cluster week_y election)
reghdfe abnormal_return dprob_cand, absorb(firm_election) vce(cluster week_y election)

*********** WEEKLY ANALYSIS *********************************

* Sum abnormal returns during the week
egen CAR = sum(abnormal_return), by(donat week)

* Now just keep an observation per week, Friday
gen d_week = dow(bet_date)
keep if d_week == 5

* Create the panel properly again
drop nobs
sort donat bet_date
by donat: gen nobs = _n 

xtset donat nobs
sort donat nobs

* Take differences of the implied winning probability
drop dprob_cand
gen dprob_cand_week = d.prob_cand

* PANEL B Results
reghdfe CAR dprob_cand_week, absorb(constant) vce(cluster week_y election)
reghdfe CAR dprob_cand_week, absorb(firm_cycle) vce(cluster week_y election)
reghdfe CAR dprob_cand_week, absorb(firm_election) vce(cluster week_y election)

